package FactoryMethod.factory;

import FactoryMethod.java.BaoMaCar;
import FactoryMethod.java.Car;
import FactoryMethod.java.DaZCar;

/**
 * @author feng
 * @Date 2021/10/14 20:55
 */
public class SFactory {
    Car car = null;

    public Car getCar(String name) {

        if (name.equals("DaZ")) {
            car = new DaZCar();
        } else if (name.equals("BaoMa")) {
            car = new BaoMaCar();
        }
        return car;
    }

}
